package com.it.zhangjun.effective;

/**
 * @author jun.zhang6
 * @date 2021/4/12
 */
public class SingletonUser {

    private SingletonUser() {

    }

    public static enum SingletonEnum {
        INSTANCE;

        private SingletonUser singletonUser;

        private SingletonEnum() {
            this.singletonUser = new SingletonUser();
        }

        public SingletonUser getSingletonUser() {
            return singletonUser;
        }

        public void setSingletonUser(SingletonUser singletonUser) {
            this.singletonUser = singletonUser;
        }
    }

    public static SingletonUser getInstance() {
        return SingletonEnum.INSTANCE.getSingletonUser();
    }
}
